package foundation.string_comparison;

import java.util.Scanner;

/**
 * 字符串对比
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str1 = sc.next();
        String str2 = sc.next();
        int l1 = str1.length();
        int l2 = str2.length();
        if (l1 != l2) {
            System.out.print(1);
        } else {
            if (str1.equals(str2)) {
                System.out.print(2);
            } else if (str1.toLowerCase().equals(str2.toLowerCase())){
                System.out.print(3);
            } else {
                System.out.print(4);
            }
        }
    }
}
